package com.hcxdi.base.presenter;

import rx.Subscription;
import rx.subscriptions.CompositeSubscription;

/**
 * Created by jiajiabao on 16-11-14.
 */

public abstract class RxPresenter<V> extends AbstractPresenter<V> {

    private CompositeSubscription subscriptions = new CompositeSubscription();

    @Override
    public void onDestroyed() {
        super.onDestroyed();
        subscriptions.unsubscribe();
    }

    public void addSubscription(Subscription subscription) {
        subscriptions.add(subscription);
    }

    public void removeSubscription(Subscription subscription) {
        subscriptions.remove(subscription);
    }
}
